package com.jcfk.system.dao;

import com.jcfk.common.business.dao.BaseDao;
import com.jcfk.common.business.power.annotation.DataPowerFilter;
import com.jcfk.common.web.domain.DataPage;
import com.jcfk.system.domain.dto.SysUserDTO;
import com.jcfk.system.domain.dto.SysUserVo;
import com.jcfk.system.domain.dto.SysUserWithRoleIdDTO;
import com.jcfk.system.domain.dto.UserOrganizationParameter;
import com.jcfk.system.domain.po.SysUser;
import com.jcfk.system.domain.query.SysUserQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 单表 数据访问
 * @author 李炳海
 * @date 2023/9/30
 */
@Repository
public interface SysUserDao extends BaseDao<SysUser> {
    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    DataPage<SysUserDTO> queryByPage(@Param("page") DataPage<SysUserDTO> page, @Param("query") SysUserQuery query);

    DataPage<SysUserVo> listByPage(@Param("page") DataPage<SysUserVo> page, @Param("query") UserOrganizationParameter query);

    SysUserDTO getByLoginName(@Param("loginName") String loginName);

    String getEmpNoByMobile(@Param("mobile") String mobile);

    List<SysUser> queryUsersByOrganAndRole(@Param("organIds") List<String> organizationIds,
                                           @Param("roleIds") List<String> roleIds);

    List<SysUserWithRoleIdDTO> getUserListByRoleIds(@Param("roleIds") List<String> roleIds);
}
